<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2022-12-21 11:17:00
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-12-21 11:23:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var num1 = 100;
        // num1 = num1+100;
        // alert(num1);


        // 交换两个变量的值 仅限数值 
        var num1 = 100;
        var num2 = 200;
        console.log('num1:',num1);
        console.log('num2:',num2);
        console.log('--------------');
        num1 = num1+num2; // num1 300 
        // num2 还是200;
        num2 = num1-num2; // num2 100 
        // num1 还是 300
        num1 = num1 - num2; // num1 200


        console.log('num1:',num1);
        console.log('num2:',num2);


    </script>
</body>
</html>